package com.xianbaovip.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

//
//@EnableDiscoveryClient//开启eureka客户端发现功能
//@SpringBootApplication
//@EnableCircuitBreaker //开启熔断

@SpringCloudApplication

@EnableFeignClients//开启Feign功能
public class consumerApplication {
    public static void main(String[] args) {
        SpringApplication.run(consumerApplication.class, args);
    }
    @Bean
    @LoadBalanced //负载均衡的注解
    public RestTemplate restTemplate(){
        return  new RestTemplate();
    }

}
